﻿using System.Text.RegularExpressions;

namespace ATM.Terminal.Shared
{
    public static class StringExt
    {
        public static string Mask(this string self)
        {
            var result = string.Empty;

            for (var i = 0; i < self.Length; i++)
            {
                result += "*";
            }

            return result;
        }

        public static bool IsNumeric(this string self)
        {
            var regex = new Regex(@"^[-+]?[0-9]*\.?[0-9]+$");

            return regex.IsMatch(self);
        }
    }
}
